home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
gui4cli
/
tools
/
rtn
/
findfile
< prev
next >
Wrap
Text File
|
1999-05-14
|
1KB
|
56 lines
G4C
; FindFile FileName
; Ask the user to show us where he has the given file.
; Returns the filename
xONLOAD filename
; quit file here.. This seems weird, but remember that guiquit will just
; mark the gui for quiting. The gui will actually quit *after* it has
; executed all it's commands..
guiquit findfile
; check that we were given a file name
if $filename = ''
say '*ERROR: guis:tools/rtn/FindFile requires an argument!'
stop
endif
; check if the file already exists
ifexists file $filename
return $findfile/filename ; always use full variable path
endif
; ask for file
ezreq "$filename was not found..\n\nDo you want to look for it ?" "Browse..|Ignore|CANCEL" choice
if $choice = 0 ; no he don't
return ""
elseif $choice = 2 ; ignore
return "guis:c/comline"
endif
; go find the file..
name = ''
ReqFile -1 -1 300 200 "Locate $filename:" LOAD name ''
if $name = "" ; cancelled
return ""
elseifexists file $name
return $findfile/name ; success - Return *Full* variable Path!!
else
ezreq "File does not exist!\nWhat now.. ?" 'Continue..|CANCEL' choice
if $choice = 0 ; canceled
return ""
else
return "guis:c/comline" ; oh well..
endif
endif